From: Maksim Mazko Date: Mon, 2 Mar 2026 17:44:56 +0000 (+0300) Subject: status/keyboard: Preserve MRU order while IBus is disabled X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~26^2~1^2~3 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=8e0f850edc03ada8f79ef68412eabb05c5f76d02;p=gnome-shell.git status/keyboard: Preserve MRU order while IBus is disabled In password fields, IBus sources are temporarily disabled and a backup of the MRU list is created. If the user switches layouts in that state, the active MRU list is updated, but the backup is not. When IBus is enabled again, the stale backup is restored and the order the user just selected is lost. Sync the backup on interactive source switches while IBus is disabled, so the MRU order stays consistent. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8538 Part-of: --- diff --git a/js/ui/status/keyboard.js b/js/ui/status/keyboard.js index b1527e3c4..72d15e604 100644 --- a/js/ui/status/keyboard.js +++ b/js/ui/status/keyboard.js @@ -484,7 +484,7 @@ export class InputSourceManager extends Signals.EventEmitter { this._settings.mruSources = sourcesList; } - _currentInputSourceChanged(newSource) { + _currentInputSourceChanged(newSource, interactive) { let oldSource; [oldSource, this._currentSource] = [this._currentSource, newSource]; @@ -495,6 +495,16 @@ export class InputSourceManager extends Signals.EventEmitter { ...this._mruSources.filter(s => s !== newSource), ]; + // Only track user-initiated switches in backup MRU. + // Internal (non-interactive) activations during reload/reapply must not affect restore order. + if (interactive && this._disableIBus && this._mruSourcesBackup) { + this._mruSourcesBackup = [ + newSource, + ...this._mruSourcesBackup.filter( + s => s.type !== newSource.type || s.id !== newSource.id), + ]; + } + this._changePerWindowSource(); } @@ -512,7 +522,7 @@ export class InputSourceManager extends Signals.EventEmitter { this._ibusManager.setEngine(engine); - this._currentInputSourceChanged(is); + this._currentInputSourceChanged(is, interactive); if (interactive) this._updateMruSettings();